package thread;

/**
 * Created with IntelliJ IDEA.
 * Description:
 * User: Ap0stoL2
 * Date: 2023-07-23
 * Time: 22:56
 */
class SumAll{
    public int count =0;

    public void increase(){
        //this.count++;
        count++;
    }
    
}
public class atest {
    public static void main(String[] args) throws InterruptedException {

        SumAll counter = new SumAll();

        Thread t1 = new Thread(()->{
            for(int i=0;i<10;i++) counter.increase();
        });


        t1.start();
        t1.join();
        System.out.println(counter.count);

    }
}
